package filters;

import java.util.ArrayList;
import java.util.List;

import model.db.VerticalResult;

public class FilterContentNoAppropriate {

	/**
	 * @param args
	 */
	
	private static String stop_words[]={"sex", "sexo", "porn", "gay",
	"horny", "puto", "puta", "fuck", "lesbian", "shemale"	
	};
	
	
	public static boolean appropriate(String s){
		
		
		for(int i=0; i<stop_words.length; i++){
			
			if(s.contains(stop_words[i])){
				return false;
				
			}
		}
		
		
		return true;
		
	}
	
	public static List<VerticalResult> cleanVerticalResults( List<VerticalResult> v){
		
		 List<VerticalResult> vv= new ArrayList<VerticalResult>();
		for(int i =0; i<v.size(); i++){
			
			
			VerticalResult temp = v.get(i);
			if(appropriate(temp.getSnippet()) && appropriate(temp.getTitle())){
				vv.add(temp);
			}
			
		}
		return vv;
		
	}
	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}
